package com.syf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.syf.domain.store.BsNotice;
import com.syf.mapper.BsNoticeMapper;
import com.syf.service.BsNoticeService;
/**
*
*
*@author syf
*@create 2022-02-07 19:09
*/
@Service
public class BsNoticeServiceImpl extends ServiceImpl<BsNoticeMapper, BsNotice> implements BsNoticeService{

    /**
     * 分页条件查询--资讯列表【标题】
     *
     * @param page
     * @param title
     * @return
     */
    @Override
    public Page<BsNotice> findByPage(Page<BsNotice> page, String title) {
        LambdaQueryWrapper<BsNotice> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(title),BsNotice::getTitle,title)
                .orderByDesc(BsNotice::getCreateTime);
        return page(page, wrapper);
    }
}
